package social.p2p.model;

import social.p2pnative.Advertisement;
import social.p2pnative.Field;
import social.p2pnative.Indexed;
import social.p2pnative.PartialImplAdvertisement;

/**
 *
 * @author cadmilo
 */
@Advertisement(mimeType = "text/xml")
public abstract class NodoFotoAdvertisement extends PartialImplAdvertisement {

    private static final long serialVersionUID = 1L;
    protected String id;
    @Indexed
    @Field
    protected String name;
    @Field
    protected String connectionTime;

    public NodoFotoAdvertisement() {
    }

    public String getConnectionTime() {
        return connectionTime;
    }

    public void setConnectionTime(String connectionTime) {
        this.connectionTime = connectionTime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (o instanceof NodoFotoAdvertisement) {
            NodoFotoAdvertisement oo = (NodoFotoAdvertisement) o;
            return this.getPipeAdv().getID().toURI().toString().equals(oo.getPipeAdv().getID().toURI().toString());
        } else {
            return false;
        }
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 59 * hash + (this.name != null ? this.name.hashCode() : 0);
        hash = 59 * hash + (this.connectionTime != null ? this.connectionTime.hashCode() : 0);
        return hash;
    }
}
